home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / tutorial / adatu311.zip / TOMORROW.ANS (.png) < prev    next >
ANSI Art File  |  1996-01-10  |  876b  |  640x320  |  1-bit (2 colors)
Labels: text | screenshot | font
OCR: Our solution to Outside Assignment 3: separate (Nextdate) function Tomorrow (Today : in Date) return Date is Length : array (Month_Type) of Day_Subtype := (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); Answer : Date; begin if Today. Year mod 4 = 0 and (Today. Year mod 100 /= 0 or Today. Year mod 400 = 0) then Length(Feb) := 29; end if; if Today. Day /= Length (Today. Month) then -- Not end of month. Answer := (Today. Day + 1, Today. Month, Today . Year); elsif Today. Month /= Dec then == End of month, but not end of year. Answer := (1, Month_Type' Succ (Today. Month), Today . Year) ; else -- End of year. Answer := (1, Jan, Today . Year + 1); end if ; return Answer; end Tomorrow;